from django import template
from datetime import datetime
from appBlog.models import Poem


register = template.Library()

@register.simple_tag()
def current_time(format_string):
	return datetime.now().strftime(format_string)


@register.inclusion_tag('poem_list.html')
# # def poems_of_author(poem_author):
# # 	poems = Poem.objects.filter(author=poem_author)
# # 	return {'poems':poems,'author':poem_author}
def poems_of_author():
	poems = Poem.objects.all()
	return {'poems':poems}